<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<?php
$ur = Yii::app()->request->getbaseUrl() . '/';
?>
<script src="<?php echo $ur . 'protected/extensions/bootstrap/dist/js/bootstrap.min.js'; ?>"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/specialJsFunction.js"></script>	
<script type="text/javascript">
    $(document).ready(function() {
        // Create two variable with the names of the months and days in an array
        //var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; 
        var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
        //var dayNames= ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]
        var dayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]

        // Create a newDate() object
        var newDate = new Date(<?php echo time(); ?> * 1000);
        // Extract the current date from Date object
        newDate.setDate(newDate.getDate());
        // Output the day, date, month and year   
        $('#Date').html(dayNames[newDate.getDay()] + ", " + newDate.getDate() + ' ' + monthNames[newDate.getMonth()] + ' ' + newDate.getFullYear());

        var flag1 = true;
        setInterval(function() {
            // Create a newDate() object and extract the seconds of the current time on the visitor's
            var seconds = new Date();
            if (flag1) {
                seconds.setHours(15, 35, 1);
                flag1 = false;
            }
            // Add a leading zero to seconds value
            var detik = seconds.getSeconds();
            $("#sec").html((detik < 10 ? "0" : "") + detik);
        }, 1000);

        var flag2 = true;

        setInterval(function() {
            // Create a newDate() object and extract the minutes of the current time on the visitor's
            var minutes = new Date();

            if (flag2) {
                minutes.setHours(15, 35, 1);
                flag2 = false;
            }
            // Add a leading zero to the minutes value
            var menit = minutes.getMinutes();
            $("#min").html((menit < 10 ? "0" : "") + menit);
        }, 1000);

        var flag3 = true;
        setInterval(function() {
            // Create a newDate() object and extract the hours of the current time on the visitor's
            var hours = new Date();

            if (flag3) {
                hours.setHours(15, 35, 1);
                flag3 = false;
            }
            var jam = hours.getHours();
            // Add a leading zero to the hours value
            $("#hours").html((jam < 10 ? "0" : "") + jam);
        }, 1000);
    });
</script>
<style>
    .clock {
        color: white;
        margin: -38px 0 -50px 0px;
        padding: 26px;
        width: 214px;
    }
    #Date {
        border-right: 4px solid #D3D3D3;
        font-family: 'BebasNeueRegular',Arial,Helvetica,sans-serif;
        font-size: 26px;
        text-align: center;
        text-shadow: 0 0 5px #B29A96;

    }
    ul.time {
        list-style: none outside none;
        margin: -18px 0 0 157px;
        padding: 0;
        text-align: center;
        width: 210px;
    }
    ul.time li {
        display: inline;
        font-family: 'BebasNeueRegular',Arial,Helvetica,sans-serif;
        font-size: 1.8em;
        text-align: center;
        text-shadow: 0 0 5px #B29A96;
    }
    #point {
        animation: 1s ease 0s normal none infinite mymove;
        padding-left: 10px;
        padding-right: 10px;
        position: relative;
    }
</style>
<?php /* @var $this Controller */ ?>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="en" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
            <?php
            $cs = Yii::app()->clientScript;
            $themePath = Yii::app()->baseUrl;

            /**
             * StyleSHeets
             */
            $cs->registerCssFile($ur . 'protected/extensions/bootstrap/dist/css/bootstrap.css');
            $cs->registerCssFile($ur . 'protected/extensions/bootstrap/dist/css/bootstrap-theme.css');

            /**
             * JavaScripts
             */
            $cs->registerCoreScript('jquery', CClientScript::POS_END);
            $cs->registerCoreScript('jquery.ui', CClientScript::POS_END);
            $cs->registerScriptFile($ur . 'protected/extensions/bootstrap/dist/js/bootstrap.min.js', CClientScript::POS_END);
            $cs->registerScript('tooltip', "$('[data-toggle=\"tooltip\"]').tooltip();$('[data-toggle=\"popover\"]').tooltip()", CClientScript::POS_READY);
            ?>

            <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/a-common-sigap.css" />
            <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/a-element-sigap.css" />
            <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/a-content-sigap.css" />
            <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/a-login-sigap.css" />

            <link href="<?php echo $ur . 'protected/extensions/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet'; ?>">
                <title><?php echo CHtml::encode($this->pageTitle); ?></title>
                <style>
                    body {
                        padding-top: 20px;
                        padding-bottom: 20px;
                        background: <?php echo "url(" . $ur . "images/index.png) repeat fixed 0 0 / contain rgba(0, 0, 0, 0);"; ?>
                            /*background: linear-gradient(45deg, #1336c3 0%, #1285de 100%) repeat scroll 0 0 rgba(0, 0, 0, 0);*/
                    }

                    .navbar {
                        margin-bottom: 20px;
                    }
                </style>


                <?php
                //Yii::app()->bootstrap->register(); 
                Yii::app()->clientScript->registerCoreScript('jquery');
                ?>
                </head>

                <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
                <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
                <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/sexybuttons.css" />
                <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/left-menu.css" />
                <body class="<?php if (CHtml::encode($this->pageTitle) != 'login') {
                    echo 'common';
                } else {
                    echo 'loginzzz';
                } ?>">
<?php if (CHtml::encode($this->pageTitle) != 'login') { ?>
                        <div class="navigation-wrape">
                            <div class="navigation"> <img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/logo_sigap.png" />                            

                                <!--div class="date">
                                    <ul>
                                        <li><img src="<?php //echo Yii::app()->theme->baseUrl;  ?>/images/date.png" />Wed, 2 Jul 2014</li>
                                        <li><img src="<?php //echo Yii::app()->theme->baseUrl;  ?>/images/time.png" />21:57:13</li>
                                    </ul>
                                </div-->
                                <div class="button">
                                    <ul>
                                        <li><a href="">Logout (<?php echo Yii::app()->user->getId(); ?>)</a></li>
                                        <li><a href="">Show Maps</a></li>
                                        <li><a href="">Home</a></li>
                                    </ul>
                                </div>
                                <div class="ffack"></div>
                            </div>                                                
                        </div>

<?php } if (CHtml::encode($this->pageTitle) != 'login') { ?>
                        <div class="page" >                        
                            <div class="content">
                                <div align="right" style="margin-right: 120">
                                    <div class="clock" style="font-size:8px;">
                                        <div style="margin-top:-7px;padding-right:130px"><?php echo CHtml::image(Yii::app()->request->baseUrl . '/images/calendar.png', '', array('width' => '24', 'height' => '24')) ?></div>
                                        <div id="Date" style="font-size:14px;margin-top:-20px;"></div>

                                        <ul class="time" style="font-family:Arial;">

                                            <li id="hours"></li>
                                            <li id="point">:</li>
                                            <li id="min"></li>
                                            <li id="point">:</li>
                                            <li id="sec"></li>

                                            <div style="margin-top:-23px;display:block;padding-right:166px;clear:both;"><?php echo CHtml::image(Yii::app()->request->baseUrl . '/images/time.png', '', array('width' => '24', 'height' => '24')) ?></div>
                                        </ul><br />
                                    </div></div>

                                <?php /* if (isset($this->breadcrumbs)): ?>
                                  <?php
                                  $this->widget('bootstrap.widgets.TbBreadcrumbs', array(
                                  'links' => $this->breadcrumbs,
                                  ));
                                  ?><!-- breadcrumbs -->
                                  <?php endif */ ?>

                                <?php echo $content; ?>

                                <?php
                                /* $remove = CHtml::button('Remove', array("class" => "sexybutton sexysimple sexyblue"));
                                  $this->widget('ext.jqrelcopy.JQRelcopy', array(
                                  'id' => 'copylink',
                                  'removeText' => $remove,
                                  'options' => array(
                                  'limit' => 0,
                                  'excludeSelector' => '.skipcopy',
                                  )
                                  )); */
                                ?>
                                <div class="clear"></div>

                                <div id="footer">
                                    <center>Copyright &copy; <?php echo date('Y'); ?> by SIMPADA.<br/>
                                        Demo Version 2014.<br/></center>

                                </div><!-- footer -->
                            </div>
                        </div><!-- page -->
<?php } else { ?>

    <?php echo $content; ?>

                        <div id="footerLogin">
                            <center>Copyright &copy; <?php echo date('Y'); ?> by SIMPADA.<br/>
                                Demo Version 2014.<br/></center>

                        </div><!-- footer -->

<?php } ?>

                </body>
                </html>
